package com.jpxx.netty.util;

import java.io.File;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

class Temp extends Thread {
	public void run() {
		System.out.println("run");
	}

}

public class TimeJob {
	public static void main(String[] args) {
		Temp temp =  new Temp();
		ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
		//第一次5秒  后面1秒中一次
		ScheduledFuture<?> scheduledFuture = scheduler.scheduleWithFixedDelay(temp, 5, 1,TimeUnit.SECONDS); 
		
	}
}
